package com.mantru.iotpot.dao;

import android.content.ContentValues;
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.net.wifi.WifiManager;
import android.os.Build;
import android.os.Environment;
import android.provider.Settings;
import android.telephony.TelephonyManager;
import android.text.TextUtils;

import androidx.annotation.Nullable;

import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.util.Collection;
import java.util.Enumeration;
import java.util.Map;
import java.util.Properties;
import java.util.Set;

/**
 * 菜谱分类表
 * 作者： cmh
 * 日期： 2022/12/19
 */

public class t_vegetable_info_type
{
    public String table_name = "t_vegetable_info_type";
    public String type_id,parent_type_id,type_name,sort_index,status;
    public String create_sql = "create table t_vegetable_info_type(type_id integer primary key, parent_type_id integer, type_name text, status integer, sort_index integer)";
    public String drop_sql = "drop table t_vegetable_info_type";
    public String entity_sql = "type_id=?";
    public String list_sql = "select type_id, type_name from t_vegetable_info_type order by sort_index";
    public String max_sql = "select max(type_id) as type_id, max(sort_index) as sort_index from t_vegetable_info_type";
    public String update_sql = "update t_vegetable_info_type set type_name=? where type_id=? ";
    public String delete_sql = "delete from t_vegetable_info_type where type_id=? ";

    public String[] GetEntityValues()
    {
        String[] values = new String[1];
        values[0] = type_id;
        return values;
    }

    public ContentValues GetInsertContentValues()
    {
        ContentValues cv = new ContentValues();
        cv.put("type_id", type_id);
        cv.put("parent_type_id", parent_type_id);
        cv.put("type_name", type_name);
        cv.put("status", status);
        cv.put("sort_index", sort_index);
        return cv;
    }

    public String[] GetUpdateValues()
    {
        String[] values = new String[2];
        values[0] = type_name;
        values[1] = type_id;
        return values;
    }

    public String[] GetDeleteValues()
    {
        String[] values = new String[1];
        values[0] = type_id;
        return values;
    }

}
